package com.jrapider.compent.dict;

import com.alibaba.fastjson.JSONObject;
import com.jrapider.om.JSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/dict")
@Api(tags = {"数据字典"})
public class DictController {


    @ApiOperation(value = "加载字典",httpMethod = "GET")
    @RequestMapping("/getDict")
    @ResponseBody
    public JSONObject getDict(String code,String filter){
        List<DictData> dictDataList = DictTranslater.getDict(code,filter,null);
        return JSONResult.newBuilder().success("字典加载成功").setRows(dictDataList).build();
    }
}
